package com.example.stock.entity.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.stock.entity.eo.HistoryEo;
import com.example.stock.entity.mapper.HistoryMapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HistoryDao extends ServiceImpl<HistoryMapper, HistoryEo> {

    public List<HistoryEo> listByDesc() {
        LambdaQueryWrapper<HistoryEo> historyEoLambdaQueryWrapper = Wrappers.<HistoryEo>lambdaQuery().orderByDesc(HistoryEo::getId);
        return list(historyEoLambdaQueryWrapper);
    }
}